<?php
/**
 *
 * @Author nikm $
 *
 * @Date 2012-03-14 $
 */

if(!defined('FROM_INDEX')) exit('Invalid request');

require ROOT_PATH.'module/master.mod.php';

class moduleObj extends masterObj
{	
	function __construct($request)
	{
		parent::__construct($request);

		$this->excute();
	}
	
	private function excute()
	{
		ob_start();
		
		switch($this->act)
		{
			default:
				$this->main();
				break;
		}
		
		$body = ob_get_clean();
		
		$this->showBody($body);
	}
	
	private function main()
	{
		//DBFunction::getInstance()->setDebug();
		
		$page = $this->request['offset'] + 1;
		
		$this->request['bid'] = isset($this->request['bid']) ? (int)$this->request['bid'] : '';
		$this->request['bname'] = isset($this->request['bname']) ? trim($this->request['bname']) : '';
		$this->request['content'] = isset($this->request['content']) ? trim($this->request['content']) : '';
		
		$bid = $this->request['bid'];
		$bname = $this->request['bname'];
		$content = $this->request['content'];
		
		$query_link = "index.php?m=customer_comment";
		$query_link .= $bid ? '&business_id='.$this->request['bid'] : '';
		$query_link .= $bname ? '&business_name='.$this->request['bname'] : '';
		$query_link .= $content ? '&content='.$this->request['content'] : '';
				
		$result = search_comment_list($this->request);
		
		$total_record = $result['count'];
		$page_html = page($total_record, $this->request['limit'], $page, $query_link, '20');
		
		$list = $result['result'];
		include template('business_comment');
	}
}